export default function (app) {
  app.directive("numberOnly", {
    beforeMount(el) {
      el.handler = function () {
        var input = el.getElementsByTagName("input")[0];
        if (input.value <= 0) {
          input.value = 1;
        }
      };
      el.addEventListener("input", el.handler);
    },
    beforeUnmount(el) {
      el.removeEventListener("input", el.handler);
    }, // 新增
  });
}
